<?php

namespace Modules\Common\Util;

use Illuminate\Support\Facades\App;
use Modules\Common\General\Security\Api\Gateway;

class System
{
    public static function user()
    {
        if (App::runningInConsole()) {
            return self::systemUser();
        } else {
            return Gateway::user();
        }
    }


    private static function systemUser()
    {
        return (object)[
            'id' => 0,
            'name' => 'system',
            'mobile' => 0
        ];
    }

}